cmake_minimum_required(VERSION 2.8.3)
project(lidar_tool)
SET(CMAKE_BUILD_TYPE Debug)

add_compile_options(-std=c++11)
#set(CMAKE_CXX_FLAGS "-O3 -g -Wall ${CMAKE_CXX_FLAGS}")

# set(cv_bridge_DIR /home/zwh/cv_bridge/cmake)

# find_package(OpenCV REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(Ceres REQUIRED)

find_package(catkin REQUIRED COMPONENTS
   roscpp
   rospy
   sensor_msgs
   pcl_ros
   pcl_conversions
   std_msgs
   dynamic_reconfigure
   message_generation
   cv_bridge
   image_transport
   message_filters
)

# 寻找OpenCV库
find_package(OpenCV REQUIRED)

include_directories(${PCL_INCLUDE_DIRS} include)

generate_dynamic_reconfigure_options(
   config/param_extinct.cfg
   config/param_extinct2.cfg
)

catkin_package(

   # INCLUDE_DIRS include
   LIBRARIES dynamic_refg

   # CATKIN_DEPENDS dynamic_reconfigure roscpp rospy std_msgs message_runtime
   # DEPENDS system_lib
)

include_directories(
   include
   p2p
   ${catkin_INCLUDE_DIRS}
)

message(STATUS "                         1111111111111111111 include path: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "                         1111111111111111111 LIBRARIES: ${OpenCV_LIBRARIES}")
message(STATUS "                         1111111111111111111 catkin_LIBRARIES: ${catkin_LIBRARIES}")

add_library(LIBS SHARED p2p/point2pixel.cpp p2p/point2pixel_pin.cpp p2p/point2pixel_fish.cpp)
add_executable(bag2bmp node/bag2bmp.cpp)
target_link_libraries(bag2bmp
   ${catkin_LIBRARIES}
   ${OpenCV_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(bagreset node/bagreset.cc)
target_link_libraries(bagreset
        ${catkin_LIBRARIES}
        ${OpenCV_LIBRARIES}
        ${PCL_LIBRARIES}
        )

add_executable(bag2pcd node/bag2pcd.cc)
target_link_libraries(bag2pcd ${PCL_LIBRARIES}
   ${roscpp_LIBRARIES}
   ${catkin_LIBRARIES}
)

add_executable(icp node/icp.cc)
target_link_libraries(icp ${PCL_LIBRARIES}
        ${roscpp_LIBRARIES}
        ${catkin_LIBRARIES}
        )

add_executable(bag2rgbapcd node/bag2rgbapcd.cc)
target_link_libraries(bag2rgbapcd
   LIBS
   ${catkin_LIBRARIES}
   ${OpenCV_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(pandarset node/pandarset.cc)
target_link_libraries(pandarset
        LIBS
        ${catkin_LIBRARIES}
        ${OpenCV_LIBRARIES}
        ${PCL_LIBRARIES}
        )

add_executable(dataset_view node/dataset_view.cpp)
target_link_libraries(dataset_view
        ${catkin_LIBRARIES}
        ${OpenCV_LIBRARIES}
        ${PCL_LIBRARIES}
        )

add_executable(bin2ros
   node/bin2ros.cpp
)

target_link_libraries(bin2ros
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(bin_view
   node/bin2ros.cpp
)

target_link_libraries(bin_view
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(pcd2bin
   node/pcd2bin.cc
)

target_link_libraries(pcd2bin
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(pcd2pcd
   node/pcd2pcd.cc
)

target_link_libraries(pcd2pcd
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(mutilidar
   node/mutilidar.cpp
)

target_link_libraries(mutilidar
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
)

add_executable(mutilidar_ros
        node/mutilidar_ros.cpp
        )

target_link_libraries(mutilidar_ros
        ${catkin_LIBRARIES}
        ${PCL_LIBRARIES}
        ${roscpp_LIBRARIES}
        )

add_executable(radar2lidar
        node/radar2lidar.cpp
        )

target_link_libraries(radar2lidar
        ${catkin_LIBRARIES}
        ${PCL_LIBRARIES}
        )

add_executable(lidar2camera
   node/lidar2camera.cpp
)

add_executable(annatation_diy
   node/annatation_diy.cpp
)

target_link_libraries(lidar2camera
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
   ${OpenCV_LIBRARIES}
)

add_executable(lidar2camera2
   node/lidar2camera2.cpp
)

target_link_libraries(lidar2camera2
   ${catkin_LIBRARIES}
   ${PCL_LIBRARIES}
   ${OpenCV_LIBRARIES}
   ${CERES_LIBRARIES}
)

add_executable(image_view
   node/image_view.cpp
)

target_link_libraries(image_view
   ${PCL_LIBRARIES}
   ${OpenCV_LIBRARIES}
)

add_executable(cloud_view
   node/cloud_view.cpp
)

target_link_libraries(cloud_view
   ${PCL_LIBRARIES}
   ${OpenCV_LIBRARIES}
)

add_executable(sync
   node/sync.cpp
)

target_link_libraries(sync
   ${PCL_LIBRARIES}
   ${catkin_LIBRARIES}
   ${OpenCV_LIBRARIES}
)

add_executable(txt2csv
   node/txt2csv.cpp
)
